package com.nave.segundaguerra.activity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;

import com.example.honraepodercliente.R;
import com.nave.segundaguerra.audio.SoundManager;


public class ChangeActivity 
{
	private static ChangeActivity instance;
	
	private ChangeActivity(){}
	
	public static ChangeActivity getInstance()
	{
		if(instance == null)
			instance = new ChangeActivity();
		
		return instance;
	}
	
	public void switchActivity(Activity to, Class<?> from)
	{
		Intent intent = new Intent(to, from);
		to.startActivity(intent);	
		PauseActivity();
	}
	
	public void PauseActivity() 
    {
		SoundManager.getInstance().PauseSong("MenuSound");
    }

    public void onResume(Context context)
    {
		SoundManager.getInstance().ResumeSong("MenuSound");
    }

    public void OnDestroy()
	{
		SoundManager.getInstance().StopAllSongs();	
	}
}
